﻿/// <reference path="../jquery.min.js" />
/// <reference path="../rsseasy.min.js" />
/// <reference path="../rsseasy.app.js" />
/// <reference path="../appconfig.js" />


$(function () {

    var myinfopage = $("#myinfopage");
    var btnavatar = $("#btnavatar");
    btnavatar.click(function (ev) {
        ev.preventDefault();
        ev.stopPropagation();
        masklayer.show();
        selpage.show();

        JsAdapter.onUpLoadFile = function (json) {
            btnavatar.attr("src", RssApp.UpHost + json["url"].replace(".", "l."));
            new Ajax("user/update").keyvalue("myid", RssUser.Data.myid).keyvalue("avatar", json["url"]).get(function (json) {
                RssUser.Update(json);
            });
            JsAdapter.Progress({ "action": "hide" }).Submit();
        }
    });
});